import Vue from 'vue'
import Router from 'vue-router'
import Detail from '@/components/Detail'
import Articles from '@/components/Articles'
import NoticeDetail from '@/components/NoticeDetail'
import Politics from '@/components/Politics'
import Login from '@/components/Login.vue'
import Register from '@/components/Register.vue'
import DetailGoods from '@/components/DetailGoods.vue'
import ShoppingTrolley from '@/components/ShoppingTrolley.vue'
import Address from '@/components/Address.vue'
import AddressEdit from '@/components/AddressEdit.vue'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'Articles1',
      component: Articles,
      meta:{
        isLogin: false
      }

    },
    {
      path: '/articles',
      name: 'Articles3',
      component: Articles,
      meta:{
        isLogin: false
      }
    },
    {
      path: '/politics',
      name: 'Politics',
      component: Politics,
      meta:{
        isLogin: false
      }
    },
    {
      path: '/noticeDetail',
      name: 'NoticeDetail',
      component: NoticeDetail,
      meta:{
        isLogin: false
      }
    },
    {
      path: '/detail',
      name: 'Detail',
      component: Detail,
      meta:{
        isLogin: false
      }
    },
    {
      path: '/login',
      name: 'Login',
      component: Login,
      meta:{
        isLogin: false
      }
    },
    {
      path: '/register',
      name: 'Register',
      component: Register,
      meta:{
        isLogin: false
      }
    },
    {
      path: '/datailGoods',
      name: 'DetailGoods',
      component: DetailGoods,
      meta:{
        isLogin: true
      }
    },
    {
      path: '/shoppingtrolley',
      name: 'ShoppingTrolley',
      component: ShoppingTrolley,
      meta:{
        isLogin: true
      }
    },
    {
    path: '/address',
     component: Address, 
     name: 'address', 
     meta: { 
       isLogin:true,
       title: '收货地址'
       }
     },

    {
    path: '/addressEdit', 
    component: AddressEdit, 
    name: 'addressEdit', 
    meta: {
       isLogin:true,
       title: '新增收货地址'
       } 
  },


  ]
})
